<template>
  <div class="_main">
    <div class="_main-textera">
      <el-input
          v-model="textarea"
          :rows="6"
          type="textarea"
          placeholder="please enter the address"
      />
    </div>
    <div class="_main_count">
      <div>Count:</div>
      <div>
        <el-input
            v-model="input"
            readonly
            placeholder="1"
        />
      </div>
      <div>Available:1</div>
    </div>
    <div class="_log_btn">
      <div @click="props.close">Cancel</div>
      <div @click="submit">Confirm</div>
    </div>
  </div>
</template>

<script setup>
import {defineProps, ref} from 'vue'

const props = defineProps({
  submit: {
    type: Function
  },
  close: {
    type: Function
  }
})

function submit() {
  // console.log('==', input, props)
  if (input.value > 0) {
    props.submit(input.value, textarea.value)
  }
}

let textarea = ref('')
let input = ref('1')
</script>

<style scoped lang="scss">
._main {
  padding: 26px;
}

._main-textera {
  height: 146px;
}

._main_count {
  display: flex;
  align-items: center;
  margin-top: 18px;

div {

&
:nth-child(1) {
  font-size: 14px;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: #383838;
  line-height: 20px;
}

&
:nth-child(2) {
  width: 80px;
  height: 30px;
  margin: 0 11px;
}

&
:nth-child(3) {
  font-size: 14px;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: #383838;
}

}
}
._log_btn {
  display: flex;
  align-items: center;
  margin-top: 29px;
  justify-content: space-between;

div {
  width: 206px;
  height: 45px;
  background: #FCC33C;
  font-size: 14px;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
  color: #383838;
  line-height: 45px;
  text-align: center;
  cursor: pointer;
&
:nth-child(2) {
  background-color: #EBEBEB;
}

}
}

@media screen and (max-width: 750px) {
  ._log_btn {
  div {
    width: 140px;
  }
}
}
</style>
